<?php
/**
* welcome message
* @param unknown_type $email
* @return void|string
*/
function comment_count($email = ''){
	if(empty($email))return;
	global $wpdb;
	$past_30days = gmdate('Y-m-d H:i:s',((time()-(24*60*60*30))+(get_option('gmt_offset')*3600)));
	$sql = "SELECT count(comment_author_email) AS times FROM $wpdb->comments WHERE comment_approved = '1' AND comment_author_email = '$email' AND comment_date >= '$past_30days'";
	$times = $wpdb->get_results($sql);
	$times = ($times[0]->times) ? $times[0]->times : 0;
	$message = $times ? sprintf(__('过去一个月内您评论了 <strong>%1$s</strong> 次，感谢你的关注！' ), $times) : '您很久都没有留言了，这次说点什么吧？';
	return $message;
}
?>